package com.wang.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wang.mapper.DevSwitchMapper;
import com.wang.pojo.DevSwitch;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author wcy
 * @date 2022-07-28 11:36
 */
@Service
@Transactional
public class DevSwitchServiceImpl extends ServiceImpl<DevSwitchMapper,DevSwitch> implements DevSwitchService {


    @Autowired
    private DevSwitchMapper devSwitchMapper;

    @Override
    public void updateDevSwitch(Integer devId, String isOpen) {
        devSwitchMapper.updateDevSwitch(devId, isOpen);
    }

    @Override
    public DevSwitch selectByDevId(Integer devId) {
        return devSwitchMapper.selectOne(new LambdaQueryWrapper<DevSwitch>().eq(DevSwitch::getDevId,devId));
    }


}
